package com.ruoyi.ziran.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ziran.mapper.ZrPaperItemMapper;
import com.ruoyi.ziran.domain.ZrPaperItem;
import com.ruoyi.ziran.service.IZrPaperItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 试卷题库关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ZrPaperItemServiceImpl implements IZrPaperItemService 
{
    @Autowired
    private ZrPaperItemMapper zrPaperItemMapper;

    /**
     * 查询试卷题库关联
     * 
     * @param id 试卷题库关联主键
     * @return 试卷题库关联
     */
    @Override
    public ZrPaperItem selectZrPaperItemById(Long id)
    {
        return zrPaperItemMapper.selectZrPaperItemById(id);
    }

    /**
     * 查询试卷题库关联列表
     * 
     * @param zrPaperItem 试卷题库关联
     * @return 试卷题库关联
     */
    @Override
    public List<ZrPaperItem> selectZrPaperItemList(ZrPaperItem zrPaperItem)
    {
        return zrPaperItemMapper.selectZrPaperItemList(zrPaperItem);
    }

    /**
     * 新增试卷题库关联
     * 
     * @param zrPaperItem 试卷题库关联
     * @return 结果
     */
    @Override
    public int insertZrPaperItem(ZrPaperItem zrPaperItem)
    {
        zrPaperItem.setCreateTime(DateUtils.getNowDate());
        return zrPaperItemMapper.insertZrPaperItem(zrPaperItem);
    }

    /**
     * 修改试卷题库关联
     * 
     * @param zrPaperItem 试卷题库关联
     * @return 结果
     */
    @Override
    public int updateZrPaperItem(ZrPaperItem zrPaperItem)
    {
        zrPaperItem.setUpdateTime(DateUtils.getNowDate());
        return zrPaperItemMapper.updateZrPaperItem(zrPaperItem);
    }

    /**
     * 批量删除试卷题库关联
     * 
     * @param ids 需要删除的试卷题库关联主键
     * @return 结果
     */
    @Override
    public int deleteZrPaperItemByIds(String ids)
    {
        return zrPaperItemMapper.deleteZrPaperItemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除试卷题库关联信息
     * 
     * @param id 试卷题库关联主键
     * @return 结果
     */
    @Override
    public int deleteZrPaperItemById(Long id)
    {
        return zrPaperItemMapper.deleteZrPaperItemById(id);
    }
}
